while True:
    prompt = "请输入姓名(输入'quit'结束程序):"
    name = input(prompt)
    if name == 'quit':
        print("程序已退出")
        break
    #输出姓名
    print(f"{name},你好呀!")
    with open("guest_book.txt",'a') as file_object:
        file_object.write(f"{name}拜访了本程序!\n")